package cn.codepandas.unifiedresponse.model;

/**
 * 响应结果异常
 *
 * @author Amaris
 * @since 1.0.0
 */
public final class ResultException extends RuntimeException{

    private IResultCode iResultCode;
    private Object data;

    public ResultException(IResultCode iResultCode){
        this.iResultCode = iResultCode;
    }
    public ResultException(IResultCode iResultCode, Object data){
        this.iResultCode = iResultCode;
        this.data = data;
    }

    public IResultCode getResultCode() {
        return iResultCode;
    }

    public Object getData() {
        return data;
    }

    @Override
    public String getMessage() {
        return iResultCode.getMessage();
    }

}